import request from '@/utils/request'

// 查询运转记录头表表
export function listProduction(query) {
  return request({
    url: '/production/runRecord/yzmlist',
    method: 'get',
    params: query
  })
}

// 查询运转记录头表详细
export function getRecord(yzmId) {
  return request({
    url: '/production/runRecord/getYzm/' + yzmId,
    method: 'get'
  })
}

// 查询运转记录明细list
export function getYzdlist(yzdDjbh) {
  return request({
    url: '/production/runRecord/yzdlist/' + yzdDjbh,
    method: 'get'
  })
}

// 新增运转记录头表
export function addRecord(data) {
  return request({
    url: '/production/runRecord/insYzm',
    method: 'post',
    data: data
  })
}

// 修改运转记录头表
export function updateRecord(data) {
  return request({
    url: '/production/runRecord/editYzm',
    method: 'put',
    data: data
  })
}
// 删除运转记录头表
export function delRecord(yzmDjbh) {
  return request({
    url: '/production/runRecord/delYzm/' + yzmDjbh,
    method: 'delete'
  })
}

//根据运转记录详细表Id删除
export function delYzd(yzdId) {
  return request({
    url: '/production/runRecord/delYzd/' + yzdId,
    method: 'delete'
  })
}

// 添加-查询
export function searchData(query) {
  return request({
    url: '/production/runRecord/searchData',
    method: 'get',
    params: query
  })
}


// 添加-保存
export function saveDate(data) {
  return request({
    url: '/production/runRecord/saveDate',
    method: 'post',
    data: data
  })
}

//运转记录报表
export function WorkRecordReport(query) {
  return request({
    url: '/production/runRecord/report',
    method: 'get',
    params: query
  })
}

export function submit(yzmId) {
  return request({
    url: '/production/runRecord/submit/'+yzmId,
    method: 'put'
  })
}

